<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:wh="http://java.sun.com/jsf/composite/wh"
	xmlns:p="http://primefaces.org/ui"
	xmlns:oc="http://java.sun.com/jsf/composite/owncomponents">
<h:body>
	<ui:composition template="template/companyTemplate.xhtml">
		<ui:define name="companyContent">
			<h1>Marketing Investments</h1>
			<h:form id="companyMarketing" styleClass="horizontal_full">
				<p>This site represents the investments for the Marketing.
					Marketing investments could be investments in new advertisement in
					different channels (marketing mix). 
					Marketing investments also help you to improve your image.</p>
				<h:panelGrid columns="2">
					<h:panelGrid columns="1">
						<h:panelGrid columns="3">
							<h:outputLabel for="markThis" value="Marketing-investment:" />
							<p:inputText id="markThis" tabindex="1"
								value="#{companyMBean.marketingInvestment}"
								validatorMessage="Marketing investment has to be a number between 0 and #{companyMBean.getMaxMarketing()}">
					        	<f:validateLongRange minimum="0" maximum="#{companyMBean.getMaxMarketing()}" />
					        </p:inputText>
					        <oc:fieldhelp helptext="Setting the marketing investments for this round." show="true"/>
					        
							<h:outputText value=" " />
							<p:slider for="markThis" step="10" minValue="0" maxValue="#{companyMBean.getMaxMarketing()}" style="min-width: 100px" />
							<oc:fieldhelp helptext="Slider helps you to set the investment between min and max-value." show="true"/>
							
							<h:outputLabel for="markLast"
								value="Marketing-investment (last round):" />
							<p:inputText id="markLast" disabled="true"
								value="#{companyMBean.prevMarketingInvestment}" />
							<oc:fieldhelp helptext="You have set this investment in the last round." show="true"/>
						</h:panelGrid>

						<p:commandButton value="Save Marketing Decisions"
							icon="ui-icon-disk"
							actionListener="#{companyMBean.saveMarketingDecision}" />

					</h:panelGrid>
					<p:chart type="line"
						model="#{companyMBean.marketingInvestmentsChart}"
						styleClass="companyDecisionChart" />

				</h:panelGrid>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>